﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;


/**
* @Author: AdinZ
* @Q  Q : 1454269
* @Email:adinz@adinz.com
* @Created: 2014/3/31 16:36:20
*
* */
namespace Novel.Sys.BLL
{
    public class novel_article
    {
        Dal.novel_article dal = new Dal.novel_article();
        /// <summary>
        /// 添加一本新书
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public int Add(Model.novel_article model)
        {
            return dal.Add(model);
        }
        public bool Exists(string title, string author)
        {
            return dal.Exists(title, author);
        }

        public int GetID(string title, string author)
        {
            return dal.GetID(title, author);
        }
        /// <summary>
        /// 获取记录总说
        /// </summary>
        /// <param name="strWhere"></param>
        /// <returns></returns>
        public int GetCount(string strWhere)
        {
            return dal.GetCount(strWhere);
        }

        /// <summary>
        /// 分页获取数据列表
        /// </summary>
        /// <param name="strWhere"></param>
        /// <param name="orderby"></param>
        /// <param name="startIndex"></param>
        /// <param name="endIndex"></param>
        /// <returns></returns>
        public DataSet GetListByPage(string strWhere, string orderby, int startIndex, int endIndex)
        {
            return dal.GetListByPage(strWhere, orderby, startIndex, endIndex);
        }
        /// <summary>
        /// 根据ID获取书名
        /// </summary>
        /// <param name="ID"></param>
        /// <returns></returns>
        public string GetNovelName(int ID)
        {
            return dal.GetNovelName(ID);
        }
        /// <summary>
        /// 根据id获取作者
        /// </summary>
        /// <param name="aid"></param>
        /// <returns></returns>
        public string GetAuthor(int aid)
        {
            return dal.GetAuthor(aid);
        }

        /// <summary>
        /// 获取远程数据进行下载
        /// </summary>
        /// <returns></returns>
        public DataSet GetRemoteList()
        {
            return dal.GetRemoteList();
        }

        /// <summary>
        /// 更新封面
        /// </summary>
        /// <param name="id"></param>
        /// <param name="cover"></param>
        /// <param name="local">1=本地,0=远程</param>
        /// <returns></returns>
        public int UpdateCover(int id, string cover, int local)
        {
            return dal.UpdateCover(id, cover, local);
        }
        /// <summary>
        /// 判断封面是否本地了
        /// true 已经本地
        /// </summary>
        /// <param name="id"></param>
        /// <returns>true 已经本地/</returns>
        public bool ExistsCover(int id)
        {
            return dal.ExistsCover(id);
        }

        /// <summary>
        /// /得到一个实体对象
        /// </summary>
        /// <param name="ID"></param>
        /// <returns></returns>
        public Model.novel_article GetModel(int ID)
        {
            return dal.GetModel(ID);
        }
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public DataSet GetList(string strWhere)
        {
            return dal.GetList(strWhere);
        }




        /// <summary>
        /// 修改点击数
        /// </summary>
        /// <param name="id"></param>
        /// <param name="hits"></param>
        public void UpdateHits(int id, int hits)
        {
            dal.UpdateHits(id, hits);
        }
        /// <summary>
        /// 获取点击数
        /// </summary>
        /// <param name="ID"></param>
        /// <returns></returns>
        public int GetHits(int ID)
        {
            return dal.GetHits(ID);
        }


        /// <summary>
        /// 修改下载数
        /// </summary>
        /// <param name="id"></param>
        /// <param name="downloads"></param>
        public void UpdateDownloads(int id, int downloads)
        {
            dal.UpdateDownloads(id, downloads);
        }
        /// <summary>
        /// 获取下载数
        /// </summary>
        /// <param name="ID"></param>
        /// <returns></returns>
        public int GetDownloads(int ID)
        {
            return dal.GetDownloads(ID);
        }








    }

}


